<?php 
namespace app\app\controller\v1;
use app\app\model\UserCoupon;
use app\app\util\OnlineUtils;

class UserCouponController extends BaseController{

	/**
	 * [index 用户优惠券列表]
	 * @return [type] [description]
	 */
	public function index()
	{
		$user_id = OnlineUtils::getUserIdBySid();
		//使用状态
		$status = input('get.status');
		$usercoupon = new UserCoupon();
		$usercoupon->user_id = $user_id;
		try {
			$coupon = $usercoupon->getAll($status);	
		} catch (Exception $e) {
			return jsonReturn(402,'查询失败');
		}
		return jsonReturn(200,'success',$coupon);
	}

}